package com.weasel.http.builder;

import org.apache.commons.lang.StringUtils;

/**
 * Created by Dylan on 2015/10/8.
 */
public class HttpUrlBuilder {
    private String url = "";

    public HttpUrlBuilder(String _url){
        this.url = _url;
    }
    public HttpUrlBuilder addParam(String key,String value){

        boolean b = StringUtils.contains(url, "?");
        String startTag = "?";
        if(b){
            startTag = "&";
        }
        url = url + startTag + key + "=" + value;
        return  this;
    }

    public String build(){
        return url;
    }
}
